<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2017/7/7
 * Time: 16:30
 * Project name: PHPTEST
 * File name: 1.php
 * @copyright Copyright (c) 2016 ZRX Software LLC
 * @license https://github.com/zhangrxiang
 * @since 1.0.0
 */

$redis = new Redis();
$redis->connect( "localhost", 6379 );
for ( $i = 0; $i < 100; $i ++ ) {
	$time = date("Y-m-d H:i:s",time());
	echo $time.PHP_EOL;
	$redis->set($i,file_get_contents(__FILE__));
	sleep(1);
}

for ( $i = 0; $i < 100; $i ++ ) {
	echo $redis->get($i).PHP_EOL;
	$redis->del($i);
	sleep(1);
}

$redis->client('LIST');
$redis->close();